<template>
	<div class="setting">
		<BaseHeader title="设置" showBack="true" preventGoBack="true" backText="" :back="back" ></BaseHeader>
		<group class="mtHeader">
		    <cell title="关于我们" is-link @click.native="showTab('about')"></cell>
		</group>
		<group class="logout">
		    <cell>
		    	<span slot="title" v-on:click="logout">退出</span>
		    </cell>
		</group>
		<About ref="about"></About>
	</div>
</template>
<script>
import {Group,Cell} from 'vux'
import BaseHeader from 'touch/components/common/header';

import About from  'touch/components/home/service/setting/about';
import Axios from 'touch/config/axios';

export default{
	components :{
		BaseHeader,
		Group,
    	Cell,
    	About,
	},
	data () {
		return {
			show : false,
		}
	},
	methods:{
		back(){
			this.$router.go(-1);
		},
		showTab(name){
			this.$refs[name].show = true;
		},
		logout(){
			const _this = this
			this.$vux.confirm.show({
		        title: '退出登录？',
		        onConfirm () {
		        	Axios.Auth.Logout()
			        .then(res =>{
			        	if(!res) return false;
			        	_this.$vux.toast.show({type : 'text', text:res.msg});
			            if(res.code==0){
			            	setTimeout(function(){
			            		window.location.href="/auth/#/login";
			            	},1000)
			            }
			        })
		        }
		    })

		}
	}
}
</script>
<style>
	.logout .vux-label{text-align: center !important;}
	.logout .vux-label span{display: block;width: 100%;height: 100%;}
</style>